devfandomcom-20200223-history
Talk:FileUsageAuto-update
Suggestions I know that there are definitely things that could be improved in this script, and if you see anything that is immediately obvious, please tell me! I enjoy learning better coding techniques as I fix things, and would appreciate any feedback. Thanks! --Foodbandlt 22:00, February 15, 2013 (UTC) Example A live example would be good. leviathan_89 09:40, June 18, 2013 (UTC) :I actually wanted to throw in a live example, but that would require adding the "movefile" right to the * usergroup on my test wiki to allow anyone to move files. I suppose I'll contact Staff to do that. --Foodbandlt 12:26, June 18, 2013 (UTC) ::Or you can post a link to a wiki where it's used. leviathan_89 17:34, June 18, 2013 (UTC) :::This script adds functionality to Special:MovePage when moving a file. You wouldn't be able to see or use it without the "move" and "movefile" rights. --Foodbandlt 18:36, June 18, 2013 (UTC) Batch Renaming I would love to see the ability to rename a bunch of images at once then have there file links updated. Icecreamcaekbot talk• 19:59, June 19, 2013 (UTC) :I'll look into reworking some of the code to accommodate this. I've been meaning to rework that part for a while now anyway, and that would allow for things like this. --Foodbandlt 18:18, June 21, 2013 (UTC) Minified Seeing as this script cannot be used without MediaWiki, is there any reason to have a minified version when ResourceLoader automatically minifies and strips comments from scripts? :There was something in one of the previous versions that broke the script when it was minified with importArticles, and importScript does not minify anything. For whatever reason, it wasn't broken when I minified it myself. I'm rewriting the script right now and making sure all syntax is correct, so I'll test it with importArticles again once I'm done. --Foodbandlt 04:18, July 9, 2013 (UTC) Templates Is it possible to make this script work for templates? 12:11, September 9, 2013 (UTC) :Yes, although it would take a lot of editing and would be a little more dangerous because templates don't require additional user rights to move on most wikis. It's a little bit more efficient in the long run to just leave a redirect seeing as the Template namespace isn't usually as crowded as the File namespace. If I were to edit this to work with templates, I would be more inclined to make it an entirely separate script... but I don't have the time to do that right now. — Foodbandlt (talk) 12:53, September 9, 2013 (UTC) ::Alright, thanks for the fast reply! 16:28, September 9, 2013 (UTC) Work How do I get it to work? I can't add stuff to the queue. -- WM 23:20, September 9, 2013 (UTC) :Well, what do you see? Do the buttons and the Queue dropdown option appear for you? What browser are you using? Have you cleared your cache? — Foodbandlt (talk) 23:24, September 9, 2013 (UTC) ::I am using Chrome on a Windows. I tried it on both the incognito and regular modes. The queue dropdown option appears. I have cleared my cache also. -- WM 23:20, September 9, 2013 (UTC) :::This script adds buttons to Special:MovePage (which is the page that you use to rename files). You add things to the queue through Special:MovePage, then manage the queue through said dropdown option. — Foodbandlt (talk) 23:36, September 9, 2013 (UTC) ::::And I assume you need to be an admin on the Wiki to make it work, correct? -- WM 23:39, September 9, 2013 (UTC) :::::You only need to have the rights to move files, so you don't necessarily need to be an administrator. If the "Rename" option appears in the dropdown on any File page, then you have said rights. — Foodbandlt (talk) 23:41, September 9, 2013 (UTC) ::::::Okay. Thanks for the explanation. I would suggest adding this to the main article so others won't have the same confusion. -- WM 23:44, September 9, 2013 (UTC) :::::::Will do, thanks for the suggestion! — Foodbandlt (talk) 23:45, September 9, 2013 (UTC) "Invalid file extension" Hi, even though the script is great and has saved me many hours, there seems to be a problem. When i try to rename a .PNG file and make it.png, it won't let me. It says "Invalid file extension". Is it possible to fix that? 07:28, September 10, 2013 (UTC) :Woops, sorry about that. Looks like I forgot to make it case-insensitive. I'll throw an update out a little later today. — Foodbandlt (talk) 12:03, September 10, 2013 (UTC) ::Ok, thanks! 14:16, September 10, 2013 (UTC) :::Done. — Foodbandlt (talk) 21:41, September 10, 2013 (UTC) Bot flag Is possible to add a bot flag option? Given that the user has the power to flag bot himself, of course. leviathan_89 15:09, September 14, 2013 (UTC) :Yes, it's entirely possible. I've opted to let people decide that themselves because it would spam the user rights logs with every single rename performed. If it's something you'd like to see in this script, let me know and I'll try to find the best way to include it. On my home wiki I actually wrote this to make switching your bot flag a little easier because of the amount of entries something like this script makes on Special:RecentChanges. — Foodbandlt (talk) 06:11, September 15, 2013 (UTC) :Actually, looking back at it I might've misunderstood your question. The above response goes as far as adding the bot flag to the account, but if you're talking about the edits being made by the script being submitted as bot edits then that already exists. If the bot flag on an account is set, all edits made will appear as bot edits. — Foodbandlt (talk) 18:05, September 15, 2013 (UTC) ::Not true. Even if the user editing is a bot, the edits will only show up as a bot if you specify &bot=1 specifically in the api. --[[User:Kangaroopower|'Kangaroopowah']] ([[User Talk:Kangaroopower|'Talk']]) 20:38, September 15, 2013 (UTC) :::I said that because I did indeed specify that. — Foodbandlt (talk) 21:04, September 15, 2013 (UTC) Bug Every page that it updates a link on gets added to Category:Pages with broken file links. The pages disappear from that list as soon as the page is edited (even just changing nothing and hitting publish). So it's an easy fix, but it shouldn't need to be done in the first place. —RyaNayR (talk) 23:51, November 11, 2013 (UTC) :Using "Rename and replace", this is the case because the pages are edited before the file is moved. This is done out of simplicity and to still utilize Wikia's built-in move page, but I've already written the function that does its job for the queue function so I'll change that with the next update I do to this script. I assume you are talking about "Rename and replace", right? — Foodbandlt (talk) 02:09, November 12, 2013 (UTC) ::Yes, it happens when I use "Rename and replace". So wait, you mean if I use the queue instead, that won't happen? —RyaNayR (talk) 04:36, November 12, 2013 (UTC) :::I'm not saying it'll never happen when you use the queue, I'm saying it's far less likely for it to happen. Depending on the speed of Wikia's servers and number of files moved, there's always a chance that it will happen but it's far less than its guaranteed happening in Rename and replace. I don't want to force you to use the queue over Rename and replace, so I'll be throwing an update out some time in the next week. Thanks for the suggestion! — Foodbandlt (talk) 05:31, November 12, 2013 (UTC) ::::No prob. And thanks for the soon-to-come update! —RyaNayR (talk) 06:03, November 12, 2013 (UTC) :::::Long time past due, but I've just put out a major update that includes what we discussed here. Sorry for the inconvenience. — Foodbandlt (talk) 06:44, April 10, 2014 (UTC) Badges Would it be possible for the script to detect if a wiki has badges disabled and, if so, to suppress warnings/messages related to them? The one leading me to ask is the badge-boosting warning shown on File:FileUsageAuto-update Special MovePage.png; I've not used this script before, though, so I don't know if there are other such messages. 「ディノ奴 」? · ☎ Dinoguy1000 02:06, May 12, 2014 (UTC) :That's actually just the message that that wiki has specified. I left the option to append a message at the bottom of the wall of text in case a wiki wanted to, for instance, warn about badge boosting or whatever they feel is important. By default it's blank. — Foodbandlt (talk) 03:00, May 12, 2014 (UTC) ::Aha, thanks for the clarification. =) 「ディノ奴 」? · ☎ Dinoguy1000 04:02, May 12, 2014 (UTC) Queue Problems The queue seems to be a bit buggy lately. I am renaming images en masse, and trying to use the queue to do so. However, it usually turns up about half the images therein with an error and kicks them out of the queue. I am having to re-queue images at least once, sometimes twice. Further, the failed images do no appear in the failure list. 17:23, July 28, 2014 (UTC) :Sorry, I've been a little busy over the past few months. This might be related to not having the necessary throttling that the Wikia API requires to use. I'll look into this. Would you mind including a couple links that you tried to rename (if you remember)? I know it's been a while since you've posted this, sorry. Thanks! — Foodbandlt (talk) 04:40, September 29, 2014 (UTC) hookaborted Hi. I tried to move w:c:naruto:File:Fū_(Jinchūriki).png to w:c:naruto:File:Fū.png. As a rollback user, I also have the ability to suppress redirects, so I checked that tickbox. However, when I tried to do "Rename and replace", it didn't change anything and told me the queue was cleared because the hook was aborted (it said "hookaborted" as a reason). Any ideas as to why this is? I've had no issues moving files to names with macrons in them in the past. --SuperSajuuk Talk Page | Tabber Code | Channel 10:30, August 10, 2014 (UTC) :Sorry, I've been a little busy over the past few months. The error code that you see if returned from the Wikia API directly as it reads. I'll look into the issue on my test wiki and see if I can replicate it. Thank you for including so much detail! — Foodbandlt (talk) 04:39, September 29, 2014 (UTC) Naruto Wiki Italia Hello. As you may see, I updated this code to my wikia. However, I do not see the button whenever I try to rename an image. Maybe I missed something? Many thanks.--User talk:JOA20 22:33, December 1, 2014 (UTC) :This is because I have no included multilingual support for this script yet. It relies on the English spelling of things to work properly at the moment. I'll try to include that in the next week or so if I have time. — Foodbandlt (talk) 05:22, December 21, 2014 (UTC) :I've just finished including multilingual support if you'd like to help by providing a translation so that it will work in Italian. — Foodbandlt (talk) 07:11, December 27, 2014 (UTC) ::If you would like, I can set up the script so that you only need to import a single script regardless of language, and the script would autodetect the language of the wiki in question. Code Lyoko Wiki: User: Deadcoder 16:09, December 30, 2014 (UTC) :::Well, it already auto-detects the language and imports the appropriate languages for user/wiki language. What did you have in mind, though? — Foodbandlt (talk) 16:28, December 30, 2014 (UTC) ::::I was going to suggest consolidating it into a single script file, but having seen how large the language packs are, never mind.Code Lyoko Wiki: User: Deadcoder 19:09, January 2, 2015 (UTC) Loading more than once It'd be nice if the script wouldn't load more than once (e.g. check if script element ids already exist), as the script is sometimes installed wiki-wide and causes duplicate elements. :Done, thanks! — Foodbandlt (talk) 18:58, December 21, 2014 (UTC) Redirects I understand modifying the pages with the old file names gets rid of most of the need for redirects, but why not respect the "Leave a redirect behind" checkbox? There are some things this tool can never be sure to take care of, like links from other sites or related wikis using the files by shared image repository. Robo Kiss (talk) 17:50, January 2, 2015 (UTC) :Good point. I'll look at including this today. Thanks! — Foodbandlt (talk) 18:17, January 2, 2015 (UTC) :Done. Let me know if you encounter any issues. — Foodbandlt (talk) 01:36, January 3, 2015 (UTC) Invalid File Extension Manually adding some replacements to the queue, if one tries to replace a PNG with a JPEG or vice-versa, it will say "Invalid file extension." I know Wikia doesn't let you replace files of one type with another or rename them with a different extension, but replacing uses of one file type with another shouldn't be a problem.JoshuaJSlone (talk) 08:35, January 5, 2015 (UTC) :You make a good point. I've removed the file extension checking for manual adds. — Foodbandlt (talk) 13:26, January 5, 2015 (UTC) Ghost Move bug First, thanks for implementing previous suggestions. Second, I've just had an especially weird bug. I had a queue of 6 files to be moved and references to them updated. It gave failures on 4 of them, which seemed a bit crazy--so I went to try moving them each individually, but there was no longer anything there. I checked the move logs and delete logs, but there was no trace of them--just the move records from the two files that did get moved. However, I did find that those other 4 files did still exist, at their new names--they just didn't leave behind a redirect, any trace in logs, or get their page uses automatically changed.Robo Kiss (talk) 06:46, January 13, 2015 (UTC) :I've just had a smaller second case of this. It hasn't been unusual for 1 out of a queue of 5-8 files to fail to move for some reason, but this time the 1 really did get moved and again left no trace and an apparent broken image on a page. Since I didn't include it last time, here's the error message given when it claimed to not move it: The file "Shining-Butterfly-regular.jpg" was unable to be moved to "ShiningButterfly-r.jpg" for reason: "internal_api_error_DBQueryError" . "Shining-Butterfly-regular.jpg" has been removed from the queue.JoshuaJSlone (talk) 07:03, January 13, 2015 (UTC) :BTW, this is my main account and Robo Kiss is what I use for bot actions, so this is still just one person reporting this error.JoshuaJSlone (talk) 07:05, January 13, 2015 (UTC) ::Okie doke. The error "internal_api_error_DEQueryError" isn't a standard API error. It's usually related to something wrong with Wikia. I've heard of this happening on page edit submissions, but never on file moves. I'm going to update the error message to include more detail on the error so we can let Wikia know exactly what's happening and see if we can get this fixed. Would you mind stopping by and pasting the entire error message here next time it happens? — Foodbandlt (talk) 14:13, January 13, 2015 (UTC) :::Will do. If it's a Wikia problem, might've fixed itself for now. I just did about 50 moves and didn't have it happen again. Still the occasional error, but these times it was telling the truth when a file wouldn't move. The file "685px-ShiawaseKyouryuuOndo.jpg" was unable to be moved to "ShiawaseKyouryuuOndo-r.jpg" for reason: "unknownerror; Unknown error: "directorycreateerror"" . "685px-ShiawaseKyouryuuOndo.jpg" has been removed from the queue.JoshuaJSlone (talk) 12:36, January 14, 2015 (UTC) ::::Odd. I've sent a support ticket to Wikia about this latest error. If you get anything similar concerning "unknownerror" or "internal_api_error", let me know so I can ask Wikia about it! Thanks! — Foodbandlt (talk) 19:12, January 14, 2015 (UTC) ::::I've added a delay timer to the submission of API requests in an effort to mitigate the "unkownerror"s and it appears to work pretty effectively. You'll notice a slight slowdown when using the script but it's hardly noticeable. If you want to increase or decrease the delay you can look at the customization section on the main page. Thanks for reporting this issue! — Foodbandlt (talk) 21:40, January 15, 2015 (UTC) File usage bug Hello. It seems that the script is unable to find file usage on French wikias. —Hulothe 14:35, January 22, 2015 (UTC) :Would you mind linking an example image that it lists is not used on any pages? I just tested the query that it uses to get the usage and it appears to be working fine on French wikis. — Foodbandlt (talk) 14:59, January 22, 2015 (UTC) ::Indeed, the API query via the url works fine. But the script won't get pages, with any file. For example here (you're an admin). —Hulothe 17:22, January 22, 2015 (UTC) :::Ahh, I see. Something that I forgot to account for (File namespaces of other languages not being 4 characters long...), heh. It should be fixed now. Thanks for letting me know! — Foodbandlt (talk) 17:42, January 22, 2015 (UTC) ::::Its just... perfect! Thank you for your great work, your scripts are awesome. —Hulothe 17:51, January 22, 2015 (UTC) Invalid file extension redux When renaming a file, attempting to change the extension ".jpeg" to ".jpg" results in the "Invalid file extension" error; ideally, the script should allow renaming between different extensions for the same format/MIME type (in addition to jpg/jpeg, if it doesn't already, it should allow changing the case on an extension). 「ディノ奴 」? · ☎ Dinoguy1000 08:03, April 3, 2015 (UTC) :Done, thanks for letting me know! Changing file extension case is already possible. Are there any other file extensions that share the same MIME type? — Foodbandlt (talk) 13:19, April 3, 2015 (UTC) ::There are a few in common usage, I think, but no others I know of that are specifically enabled for upload to Wikia. Thanks! 「ディノ奴 」? · ☎ Dinoguy1000 20:22, April 3, 2015 (UTC) Errors during update I'm using the "Rename and update icon" which warns me when the script cannot update a link due to template usage (perfectly understandable). However, when the page is reloaded I have to manually go back to the old file, then get the whatlinkshere to fix the links. Would it be possible to add a link to Special:WhatLinksHere/Old_File_Name.jpg to make that process a bit easier? :I've just noticed it won;t update links if the file namespace is lower case, e.g. file:foo.jpg ::Ah, wow. I thought File had to be capitalized. Small oversight, I'll put out a fix shortly. Sorry for the slow response time, I apparently don't get emails about this page anymore. ::Concerning a list of links to things where it wasn't updated, were you thinking something like how the queue has an error log? I didn't want to keep the user on the rename page if the rename is successful, though I think that might be the only good way to do that. I'll look into it. — Foodbandlt (talk) 07:46, September 13, 2015 (UTC) Accessing queue in Monobook Unless I'm blind, I haven't found any way to access the queue from Monobook. Is there a way and I just haven't seen it (in which case it might need to be made more visible), or is it indeed necessary to switch to Oasis? If there is no method in Monobook, I would suggest adding a link either via a tab next to the "rename" tab, or via the toolbox in the sidebar. 「ディノ奴 」? · ☎ Dinoguy1000 16:00, August 25, 2015 (UTC) :Ah, probably not. I originally said that this script would only work in Oasis and somebody changed it to include monobook. I don't do any testing in monobook so I wasn't aware. I'll look into including that shortly. Thanks! — Foodbandlt (talk) 07:47, September 13, 2015 (UTC) ::Several of the users who use the script on Yu-Gi-Oh! use Monobook as their primary skin (as do I), so this fix would be much appreciated! =) 「ディノ奴 」? · ☎ Dinoguy1000 16:45, September 13, 2015 (UTC) :::I'll push out this and the above update as soon as I'm allowed to edit the Mediawiki JS pages on my test wiki... I can't test it extensively because an old version of the script is being imported and I can't stop it. Lol. — Foodbandlt (talk) 20:13, September 22, 2015 (UTC) :::Just pushed an update. Try it out on Monobook and let me know of anything that could be improved. I'm aware of the button styles not being there (because Monobook uses ACTUAL button elements), but I don't have time to fix that today. Job for another day. — Foodbandlt (talk) 19:38, September 29, 2015 (UTC) Gallery Hello. When using this tool, it doesn't update galleries (which use a plain-text File:Foobar.jpg rather than a linked ), which means that while it can identify the page as linking to the image, it's unable to fix that entry.--TwoTailedFox (talk) 20:49, September 29, 2015 (UTC) :Keep in mind that the "File:" may be omitted as well in galleries. 「ディノ奴 」? · ☎ Dinoguy1000 21:34, September 29, 2015 (UTC) :Actually, the current version of the script updates gallery images without a "File:" just fine, as seen here; maybe the problem is specifically with those that have "File:". (Regardless, maybe it would be a good idea for the script to remove "File:" from gallery images when it updates them?) 「ディノ奴 」? · ☎ Dinoguy1000 21:41, September 29, 2015 (UTC) ::That sounds like an agreeable workaround, if Foodbandlt can code for it.--TwoTailedFox (talk) 21:43, September 29, 2015 (UTC) :::That's something I'll have to look at another day. I don't have the time to code something to determine whether a replacement is in a Gallery at the moment. I've loosened the context regex to allow it to replace File:* in galleries for the moment. Try it out and let me know if it works for you. — Foodbandlt (talk) 22:01, September 29, 2015 (UTC) Cursor style in Monobook In Monobook, the "Rename and update" and "Add to queue" links have a text cursor style instead of a link cursor style when hovering the mouse cursor over them. This should be an easy enough fix (I would think). 「ディノ奴 」? · ☎ Dinoguy1000 18:46, August 22, 2016 (UTC) "Destination name already in use" This message should include a link to the file for convenience. 「ディノ奴 」? · ☎ Dinoguy1000 21:00, August 25, 2016 (UTC) Percent encoding skip The extension does not well handle the situations where the percent encoding is used in a filename in wikitext. This replacement was handled correctly, but this one had to be done manually due to %27 being used instead of an apostrophe. Vengir (talk • contributions) 10:34, December 23, 2016 (UTC) Not working in IT It's not working on my wiki. Yes, the IT translation has yet to be approved, but I still should be able to see the EN version, shouldn't I? After all, I can see the queue button in the edit dropdown. leviathan_89 21:11, May 28, 2017 (UTC) Nvm, it's working now. leviathan_89 18:27, June 1, 2017 (UTC) New header It needs to be updated after the new header update. leviathan_89 17:32, June 18, 2017 (UTC) : I update it to the new header. Does it not work for you? -- Cube-shaped 17:34, June 18, 2017 (UTC) ::Yes it does. I think my cache wasn't updated with the new script... I'm running into a lot of cache problems these days tbh... leviathan_89 17:38, June 18, 2017 (UTC) ::Works for me too. One little thing you probably forgot about is bumping the update date. There are two places in the code for that: one in the comment and one string. Vengir (talk • contributions) 17:40, June 18, 2017 (UTC) Does't work Hello. This script still work? i have a problem with it, couldn't see anything.Dr.Bryan (talk) 13:40, July 2, 2017 (UTC) Suggestion Minor suggestion: add a link to access the queue from the notification that appears when you add a file to it. This way, when you have done adding all files you can easily access your queue. Additionally, the number of files currently on queue could be displayed in the same notification. leviathan_89 11:05, July 11, 2017 (UTC) Deletion I think this script would be perfect for deleting files as well, though you should be careful to not mess the pages and leaving big blank spaces. leviathan_89 19:07, July 24, 2017 (UTC) :To be honest, a similar script could be used for renaming templates as well. leviathan_89 22:38, July 31, 2017 (UTC) Won't let me move more than 3 files at once I am an editor at Sonic News Network and have been moving files with this tool for over a month. Recently, it wouldn't let me more than 3 files at anytime. I keep getting the error "ratelimited; You've exceeded your rate limit. Please wait some time and try again". I emptied my cookies and cache, used a different browser even, and the problem was still there. Does anyone have a possible solution to this problem? SilverPlays97 (talk) 20:57, July 25, 2018 (UTC) : Change the delay option to something bigger, like 5000 (5 seconds). -- Cube-shaped 20:59, July 25, 2018 (UTC) ::I added LIRoptions = { delay: 5000 } to my /common.js subpage and the issue still remained. SilverPlays97 (talk) 23:57, July 26, 2018 (UTC) ::: Have you enabled personal JavaScript in > Under the Hood > Enable personal JavaScript and then ? -- Cube-shaped 00:00, July 27, 2018 (UTC) Migration fandom.com Should this script work with wikis who are already migrated towards fandom.com? --Tu-Sais-Qui (talk) 21:18, November 20, 2018 (UTC) :I'm doing a little up, cos I seem to have an issue on my French wiki now that it changed to fandom.com. It is a bit similar to what I described here. Indeed, for this script, "Rename & Update" does not work. Same for "Add to the list" :/ Can someone help, please? Lady Junky 09:08, January 27, 2019 (UTC) Same thing for articles? Is there anything like this for articles, where you rename a page and it updates the links? If not, someone should work on making one because it would be an invaluable resource to have. — RyaNayR (talk • ) Edit: Ah, nevermind I tried looking for PageRenameAuto-update because I thought it was a thing, but I must not have been spelling it correctly. So, nevermind! — RyaNayR (talk • ) Files inside tags The script does not see the files inside the choose-option tags, can anyone fix it? FileCrasher (talk) 12:28, October 5, 2019 (UTC)